<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>hello</title>
		<script src="js/vue.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div id="app">
			<button type="button" @click="number=Math.ceil(Math.random()*10/2)" >抽奖</button>
			{{number}}
			<div v-for="user in users">
				<div v-if="number==user.code">
					本次幸运用户为：{{user.name}}
				</div>
			</div>
		</div>
		<script src="js/vue.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			let v=new Vue({
				el:'#app',
				data:{
					number:'',
					users:[
						{'name':'小明','code':'1'},
						{'name':'小红','code':'2'},
						{'name':'小熊','code':'3'},
						{'name':'大鱼','code':'4'},
						{'name':'小小','code':'5'},
					]
				}
			})
			
		</script>
	</body>
</html>
